Update Timeline.dev.stories.tsx to no longer use styled-components #6541
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes all usage of the deprecated
sx
prop fromTimeline.dev.stories.tsx
and migrates to CSS modules, as part of the ongoing effort to move away from styled-components.Changes Made
Created
Timeline.dev.stories.module.css
A new CSS module containing all the styles that were previously defined using
sx
props:.TimelineWithMarginLeft
).TimelineItemWithPadding
).TimelineBadgeCanvas
,.TimelineBadgeDanger
,.TimelineBadgeAccent
).TimelineBodySubtle
,.TimelineBodyDefault
).TimelineBreakThick
)Updated
Timeline.dev.stories.tsx
clsx
and the CSS modulesx
props withclassName
using CSS module classesclsx
to properly combine existing class names with new CSS module classesBefore vs After
Before (using sx props):
After (using CSS modules):
Validation
styled-components
orsx
prop usage remainsThe Timeline Dev story continues to work exactly as before with all visual styling preserved, but now uses modern CSS modules instead of the deprecated
sx
prop system.Fixes #6540.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.